home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir39 / clipboot.zip / ENVED.PRG < prev    next >
Text File  |  1993-05-03  |  3KB  |  66 lines

  1. /*┌──────────────────────────────────────────────────────────────────────┐
  2.  ▌│ Program Name: ENVED.PRG         Copyright: Gallagher Computing Corp. │
  3.  ▌│     Language: Clipper 5.0          Author: Kevin S Gallagher         │
  4.  ▌└──────────────────────────────────────────────────────────────────────┘
  5.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀           */
  6.  
  7. #include "include1.h"
  8.  
  9. #define M_COORDS   2,1,maxrow()-2,maxcol()-1
  10. #define M_LINES    120
  11.  
  12. function EnvEditor()
  13.     local oldins := readinsert(.T.), oldcolor := setcolor(DOSCOLOR)
  14.     local cEnvBlock :="", cCheckBuf :="", cBuf0 :="", cBuf1 :="", cBuf2 :=""
  15.     local nNumOfEnvs:= 0, i := 0
  16.     local SaveFullScreen()
  17.  
  18.     nNumOfEnvs  := FT_GETE( @cEnvBlock )
  19.     cCheckBuf   := cEnvBlock
  20.     setcursor(1)
  21.     @0,0 say padc("Environment Editor",80)                color MENUCOLOR
  22.     @maxrow(),0 say ;
  23.     padr(" Your current Environment Table is Displayed. "+;
  24.     "Edit and F10 to Save Esc to Abort",80)               color MENUCOLOR
  25.  
  26.     dispbox(1,0,maxrow()-1,maxcol(),"┌─┐│┘─└│ ",DOSCOLOR)
  27.     cEnvBlock := memoedit( cEnvBlock, M_COORDS, .t. , "EMemo" ,M_LINES )
  28.     if cCHeckBuf != cEnvBlock 
  29.         nNumOfEnvs:= mlcount( cEnvBlock, M_LINES)
  30.         for i := 1 to nNumOfEnvs
  31.             cBuf0 := memoline( cEnvBlock, M_LINES, i)
  32.             cBuf1 := subs( cBuf0,1,at("=",cBuf0) -1 )
  33.             cBuf2 := subs( cBuf0,  at("=",cBuf0) +1 )
  34.             if i > envcount()
  35.                 if !empty(cBuf1)
  36.                     if !empty(cBuf2)
  37.                         if EnvUsed() <= EnvSize()
  38.                             //───── add string to master environment table
  39.                             setenv( cBuf1, RTRIM(cBuf2) )
  40.                         else
  41.                             #ifdef MR_GRUMP
  42.                                ERR_MSG("OPERATION FAILED TO ADD STRING")
  43.                             #else
  44.                                alert("ERROR")
  45.                             #endif
  46.                         endif
  47.                     endif
  48.                 endif
  49.                 loop
  50.             endif
  51.             DELenv( cBuf1 )
  52.             if !empty(cBuf2)
  53.                 //───── modifiy an exist string in the master table
  54.                 SETenv( cBuf1, RTRIM(cBuf2) )
  55.             else
  56.                 //───── delete string from the master environment table
  57.             endif
  58.         next
  59.     endif
  60.     readinsert(oldins)
  61.     setcursor(0)
  62.     RestFullScreen()
  63.     setcolor(oldcolor)
  64. return nil
  65.  
  66.